#include "widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{

    audioRecorder = new QAudioRecorder;
    QAudioEncoderSettings audioSettings;
    audioSettings.setCodec("audio/amr");
    audioSettings.setQuality(QMultimedia::HighQuality);

    audioRecorder->setEncodingSettings(audioSettings);
    audioRecorder->setOutputLocation(QUrl::fromLocalFile("test.amr"));

    audioRecorder->record();


}

Widget::~Widget()
{
}

void Widget::closeEvent(QCloseEvent *event){

    Q_UNUSED(event);
    qDebug("window close");
    this->audioRecorder->stop();

}

